package com.yinNuo.collectWool.mobileApi.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yinNuo.collectWool.mobileApi.dao.WoolTaskDetailDao;
import com.yinNuo.collectWool.mobileApi.entity.WoolTaskDetail;
import com.yinNuo.collectWool.mobileApi.service.WoolTaskDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 单个羊毛(WoolTaskDetail)表服务实现类
 *
 * @author makejava
 * @since 2021-12-12 11:12:08
 */
@Service("woolTaskDetailService")
public class WoolTaskDetailServiceImpl extends ServiceImpl<WoolTaskDetailDao,WoolTaskDetail> implements WoolTaskDetailService {
    @Resource
    private WoolTaskDetailDao woolTaskDetailDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public WoolTaskDetail queryById(Integer id) {
        return this.woolTaskDetailDao.queryById(id);
    }

    /**
     * 新增数据
     *
     * @param woolTaskDetail 实例对象
     * @return 实例对象
     */
    @Override
    public WoolTaskDetail insert(WoolTaskDetail woolTaskDetail) {
        this.woolTaskDetailDao.insert(woolTaskDetail);
        return woolTaskDetail;
    }

    /**
     * 修改数据
     *
     * @param woolTaskDetail 实例对象
     * @return 实例对象
     */
    @Override
    public WoolTaskDetail update(WoolTaskDetail woolTaskDetail) {
        this.woolTaskDetailDao.update(woolTaskDetail);
        return this.queryById(woolTaskDetail.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.woolTaskDetailDao.deleteById(id) > 0;
    }
}
